<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>多租户管理系统 - 应急版本</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #f5f5f5;
            text-align: center;
        }
        .container {
            max-width: 600px;
            margin: 0 auto;
            background: white;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        h1 { 
            color: #1976d2; 
            margin-bottom: 20px;
        }
        .status {
            color: #2e7d32;
            font-size: 18px;
            margin: 20px 0;
        }
        .counter {
            background: #f0f2f5;
            padding: 20px;
            border-radius: 8px;
            margin: 20px 0;
        }
        button {
            padding: 10px 20px;
            margin: 0 5px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }
        .primary {
            background-color: #1976d2;
            color: white;
        }
        .secondary {
            background-color: #f44336;
            color: white;
        }
        .info {
            color: #666;
            margin-top: 20px;
        }
        .solution {
            background: #fff3cd;
            border: 1px solid #ffeaa7;
            padding: 15px;
            border-radius: 4px;
            margin: 20px 0;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>🎯 多租户管理系统</h1>
        
        <div class="status">
            ✅ 页面已成功加载！
        </div>
        
        <div class="solution">
            <h3>🔧 preamble 错误解决方案</h3>
            <p>如果你能看到这个页面，说明网络连接和服务器都正常工作。</p>
            <p>React preamble 错误通常是 Vite React 插件的兼容性问题。</p>
        </div>
        
        <div class="counter">
            <h3>计数器测试</h3>
            <p>当前计数：<span id="count">0</span></p>
            <button class="primary" onclick="increment()">点击 +1</button>
            <button class="secondary" onclick="reset()">重置</button>
        </div>
        
        <div class="info">
            <p>⏰ 当前时间：<span id="time"></span></p>
            <p>🌐 服务器地址：http://localhost:3000/emergency.html</p>
        </div>
        
        <h3>🛠️ 建议的解决步骤：</h3>
        <ol style="text-align: left; max-width: 400px; margin: 0 auto;">
            <li>清理浏览器缓存（Ctrl+Shift+Delete）</li>
            <li>重启 Qoder IDE</li>
            <li>删除 node_modules 后重新安装</li>
            <li>考虑使用 Create React App 或 Next.js</li>
        </ol>
        
        <p><a href="/" style="color: #1976d2;">尝试返回 React 应用</a></p>
    </div>
    
    <script>
        let count = 0;
        
        function increment() {
            count++;
            document.getElementById('count').textContent = count;
        }
        
        function reset() {
            count = 0;
            document.getElementById('count').textContent = count;
        }
        
        function updateTime() {
            const now = new Date();
            document.getElementById('time').textContent = now.toLocaleString('zh-CN');
        }
        
        updateTime();
        setInterval(updateTime, 1000);
        
        console.log('✅ 应急页面加载成功！');
        console.log('如果你看到这条消息，说明 JavaScript 运行正常。');
    </script>
</body>
</html>